<script setup lang='ts' name="housing-resources">
import { ElTag } from 'element-plus'
import { computed } from 'vue'

import { useDicts } from '../hooks/use-dicts'

const props = withDefaults(defineProps<{
    dictKey?: string
    label?: string
    value?: number | string
}>(), {
    dictKey: '',
    label: '',
    value: '',
})
const { dictKey, label, value } = toRefs(props)
const { useTag } = useDicts()

const tags = computed(() => {
    return useTag(dictKey.value, value.value, label.value)
})
</script>

<template>
    <ElTag v-if="tags"
           :type="tags?.type ?? 'primary'"
    >
        {{ tags?.label }}
    </ElTag>
</template>

<style lang="less" scoped>
</style>
